package com.bifrost.cbentity;

import javax.persistence.*;

/**
 * @author rangf
 * @date 2018/2/27
 */
@Entity
@Table(name = "BHWSC_HT")
public class SapContract {
    private String recnnr;
    private String recntxt;
    private String benocn;
    private String recnbeg;
    private String recnendabs;
    private String zzcontStatus;
    private String partner;
    private String zzbukrs;
    private String zzppbm;
    private String zzzzghn;
    private String dstatus;
    private String ddate;
    private Long noid;

    public SapContract(String recnnr) {
        this.recnnr = recnnr;
    }

    public SapContract() {

    }
    @Basic
    @Column(name = "RECNNR", nullable = true, length = 10)
    public String getRecnnr() {
        return recnnr;
    }

    public void setRecnnr(String recnnr) {
        this.recnnr = recnnr;
    }

    @Basic
    @Column(name = "RECNTXT", nullable = true, length = 80)
    public String getRecntxt() {
        return recntxt;
    }

    public void setRecntxt(String recntxt) {
        this.recntxt = recntxt;
    }

    @Basic
    @Column(name = "BENOCN", nullable = true, length = 8)
    public String getBenocn() {
        return benocn;
    }

    public void setBenocn(String benocn) {
        this.benocn = benocn;
    }

    @Basic
    @Column(name = "RECNBEG", nullable = true, length = 8)
    public String getRecnbeg() {
        return recnbeg;
    }

    public void setRecnbeg(String recnbeg) {
        this.recnbeg = recnbeg;
    }

    @Basic
    @Column(name = "RECNENDABS", nullable = true, length = 8)
    public String getRecnendabs() {
        return recnendabs;
    }

    public void setRecnendabs(String recnendabs) {
        this.recnendabs = recnendabs;
    }

    @Basic
    @Column(name = "ZZCONT_STATUS", nullable = true, length = 30)
    public String getZzcontStatus() {
        return zzcontStatus;
    }

    public void setZzcontStatus(String zzcontStatus) {
        this.zzcontStatus = zzcontStatus;
    }

    @Basic
    @Column(name = "PARTNER", nullable = true, length = 10)
    public String getPartner() {
        return partner;
    }

    public void setPartner(String partner) {
        this.partner = partner;
    }

    @Basic
    @Column(name = "ZZBUKRS", nullable = true, length = 10)
    public String getZzbukrs() {
        return zzbukrs;
    }

    public void setZzbukrs(String zzbukrs) {
        this.zzbukrs = zzbukrs;
    }

    @Basic
    @Column(name = "ZZPPBM", nullable = true, length = 6)
    public String getZzppbm() {
        return zzppbm;
    }

    public void setZzppbm(String zzppbm) {
        this.zzppbm = zzppbm;
    }

    @Basic
    @Column(name = "ZZZZGHN", nullable = true, length = 10)
    public String getZzzzghn() {
        return zzzzghn;
    }

    public void setZzzzghn(String zzzzghn) {
        this.zzzzghn = zzzzghn;
    }

    @Basic
    @Column(name = "DSTATUS", nullable = true, length = 1)
    public String getDstatus() {
        return dstatus;
    }

    public void setDstatus(String dstatus) {
        this.dstatus = dstatus;
    }

    @Basic
    @Column(name = "DDATE", nullable = true, length = 14)
    public String getDdate() {
        return ddate;
    }

    public void setDdate(String ddate) {
        this.ddate = ddate;
    }

    @Id
    @SequenceGenerator(name= "sequence",sequenceName="sequence_contract" ,allocationSize=1)
    @GeneratedValue(generator= "sequence",strategy= GenerationType.SEQUENCE)
    @Column(name = "NOID", nullable = false, precision = 0)
    public Long getNoid() {
        return noid;
    }

    public void setNoid(Long noid) {
        this.noid = noid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SapContract that = (SapContract) o;

        if (getRecnnr() != null ? !getRecnnr().equals(that.getRecnnr()) : that.getRecnnr() != null) return false;
        if (getRecntxt() != null ? !getRecntxt().equals(that.getRecntxt()) : that.getRecntxt() != null) return false;
        if (getBenocn() != null ? !getBenocn().equals(that.getBenocn()) : that.getBenocn() != null) return false;
        if (getRecnbeg() != null ? !getRecnbeg().equals(that.getRecnbeg()) : that.getRecnbeg() != null) return false;
        if (getRecnendabs() != null ? !getRecnendabs().equals(that.getRecnendabs()) : that.getRecnendabs() != null)
            return false;
        if (getZzcontStatus() != null ? !getZzcontStatus().equals(that.getZzcontStatus()) : that.getZzcontStatus() != null)
            return false;
        if (getPartner() != null ? !getPartner().equals(that.getPartner()) : that.getPartner() != null) return false;
        if (getZzbukrs() != null ? !getZzbukrs().equals(that.getZzbukrs()) : that.getZzbukrs() != null) return false;
        if (getZzppbm() != null ? !getZzppbm().equals(that.getZzppbm()) : that.getZzppbm() != null) return false;
        return getZzzzghn() != null ? getZzzzghn().equals(that.getZzzzghn()) : that.getZzzzghn() == null;
    }

    @Override
    public int hashCode() {
        int result = getRecnnr() != null ? getRecnnr().hashCode() : 0;
        result = 31 * result + (getRecntxt() != null ? getRecntxt().hashCode() : 0);
        result = 31 * result + (getBenocn() != null ? getBenocn().hashCode() : 0);
        result = 31 * result + (getRecnbeg() != null ? getRecnbeg().hashCode() : 0);
        result = 31 * result + (getRecnendabs() != null ? getRecnendabs().hashCode() : 0);
        result = 31 * result + (getZzcontStatus() != null ? getZzcontStatus().hashCode() : 0);
        result = 31 * result + (getPartner() != null ? getPartner().hashCode() : 0);
        result = 31 * result + (getZzbukrs() != null ? getZzbukrs().hashCode() : 0);
        result = 31 * result + (getZzppbm() != null ? getZzppbm().hashCode() : 0);
        result = 31 * result + (getZzzzghn() != null ? getZzzzghn().hashCode() : 0);
        return result;
    }
}
